package com.joe.codemother.core.file;

import com.joe.codemother.ai.model.MultiFileCodeResult;
import com.joe.codemother.core.SaveFileTemplate;
import com.joe.codemother.entity.enums.GenerateTypeEnum;

import java.io.File;

public class MultiFileSaveTemplate extends SaveFileTemplate<MultiFileCodeResult> {
    @Override
    protected GenerateTypeEnum generateType() {
        return GenerateTypeEnum.MULTI_FILE;
    }

    @Override
    protected File saveFiles(MultiFileCodeResult result, String dirPath) {
        this.saveFile(dirPath,"index.html",result.getHtmlCode());
        this.saveFile(dirPath,"style.css",result.getCssCode());
        this.saveFile(dirPath,"script.js",result.getJsCode());
        return new File(dirPath);
    }
}
